Average-case Analysis of Equality of Binary Trees Under the BST Probability Model
نویسنده
چکیده
In this paper a simple algorithm to test equality of binary trees currently used in symbolic computation, uniication, etc. is investigated. Surprisingly enough, it takes O(1) steps on average to decide if a given pair of trees of total size n are equal or not if the uniform probability model for the input is assumed. Moreover, other similar algorithms have qualitatively the same average complexity behavior. In this paper, we analyze this average complexity when the so-called bst probability model is assumed. The analysis is itself more complex although feasible, involving partial diierential equations and singularity analysis of Bessel functions. Nevertheless, partial diierential equations are generally unsolvable, like the one which is derived from the bivariate recurrences for the equality , and an indirect mechanism solving a simpler equation and showing asymptotical equivalence of solutions is used to obtain the main result : testing equality of a pair of binary trees of total size n and distributed accordingly to the bst probability model is (log n) on the average.
منابع مشابه
Statistics under the BST model
This thesis is devoted to the analysis of algorithms assuming that the input is distributed according to the BST probability model (thus named after the binary search trees) or to the balanced model that generalizes the former. The input set of such algorithms is some family of simply generated trees. In those models, two objects of the same size are not equiprobable, contrary to what happens i...
متن کاملAverage Analysis of Glushkov Automata under a BST-Like Model
We study the average number of transitions in Glushkov automata built from random regular expressions. This statistic highly depends on the probabilistic distribution set on the expressions. A recent work shows that, under the uniform distribution, regular expressions lead to automata with a linear number of transitions. However, uniform regular expressions are not necessarily a satisfying mode...
متن کاملPatterns in random binary search trees
Ž . ABSTRACT: In a randomly grown binary search tree BST of size n, any fixed pattern occurs with a frequency that is on average proportional to n. Deviations from the average case are highly unlikely and well quantified by a Gaussian law. Trees with forbidden patterns occur with an exponentially small probability that is characterized in terms of Bessel functions. The results obtained extend t...
متن کاملMartingales and Profile of Binary Search Trees
We are interested in the asymptotic analysis of the binary search tree (BST) under the random permutation model. Via an embedding in a continuous time model, we get new results, in particular the asymptotic behavior of the profile.
متن کاملPatterns in Random Binary Search
In a randomly grown binary search tree (BST) of size n, any xed pattern occurs with a frequency that is on average proportional to n. Deviations from the average case are highly unlikely and well quantiied by a Gaussian law. Trees with forbidden patterns occur with an exponentially small probability that is characterized in terms of Bessel functions. The results obtained extend to BSTs a type o...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1991